<template>
  <div id="app">
    <el-container>
      <el-header class="header">
        <el-row>
          <el-col :span="6">
            <h4>超市订单管理系统</h4>
          </el-col>
          <el-col :span="18">
            <el-dropdown style="float: right;padding: 20px">
              <span>王小虎</span>
              <i class="el-icon-setting" style="margin-right: 15px"></i>
              <el-dropdown-menu slot="dropdown">
                <el-dropdown-item>退出</el-dropdown-item>
              </el-dropdown-menu>
            </el-dropdown>
          </el-col>
        </el-row>
      </el-header>
      <el-row>
        <el-col :span="6">
          <el-aside class="aside">
            <el-menu :default-openeds="['1', '3']">
              <el-submenu index="1">
                <template slot="title"><i class="el-icon-message"></i>用户管理</template>
                  <el-menu-item index="1" @click="toPage('userlist')">用户列表</el-menu-item>
                  <el-menu-item index="2" @click="toPage('useradd')">添加用户</el-menu-item>
              </el-submenu>
            </el-menu>
          </el-aside>
        </el-col>
        <el-col :span="18" >
          <el-main class="main">
            <router-view></router-view>
          </el-main>
        </el-col>
      </el-row>
    </el-container>
  </div>
</template>

<script>
export default {
  name: 'App',
  methods:{
    toPage(path) {
      this.$router.push({path:"/"+path})
    }
  }
}
</script>

<style scoped>

#app {
  font-family: 'Avenir', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: #2c3e50;
}

.header {
  position: fixed;
  width: 100%;
  background-color: #fff;
  z-index: 1;
  border-bottom: solid 1px #e6e6e6;
}

.aside {
  position: fixed;
  top: 70px;
  width: 200px !important;
}
.main{
  position: relative;
  padding-top: 70px;
  left: 220px;
}
</style>
